<template>
    <div id="app">
        <shell-default :nav="navRoutes">
            <keep-alive>
                <router-view v-if="this.$route.meta.keep"></router-view>
            </keep-alive>
            <router-view v-if="!this.$route.meta.keep"></router-view>
        </shell-default>
    </div>
</template>

<script>
    import {mapActions} from 'vuex'
    import {routes} from '@/router/routes'

    export default {
        name: 'app',
        computed: {
            navRoutes() {
                return routes.filter(i => {
                    return i.meta && i.meta.isNav
                })
            }
        },
        methods: {
            ...mapActions(['appLaunch'])
        },
        mounted() {
            this.appLaunch()
        }
    }
</script>

<style lang="less">
    * {
        padding: 0;
        margin: 0;
    }

    html {
        font-family: SourceHanSansCN-Regular;
        font-size: 32px;
        color: #333;
    }
</style>

